
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;


public class Maschen {
	CopyOnWriteArrayList<Mash> maschen;
	
	public Maschen (ConcurrentHashMap<Integer, Knoten> g){
		ConcurrentHashMap<Integer , Mash> init= new ConcurrentHashMap<Integer, Mash>();
		
		for(Knoten k :g.values()){
			int id =k.getCapacity();
			Mash actMash;
			if(init.containsKey(id)){
				actMash =init.get(id);	
			}else{
				actMash =new Mash(id);
				init.put(id, actMash);
			}
			init.get(id).add(k);
			
		}
		maschen = new CopyOnWriteArrayList<Mash>(init.values());
		
	}
	
	public void add(Mash neu){
		maschen.add(neu);
	}
	
}
